#include "graph.h"
#include<bits/stdc++.h>
using namespace std;
int cnt = 2;
const int N = 210;
int iter[N], f[N], a[N][N], ans[N * N];
vector<int>v[N];
void dfs(int x) {
    for(int i = 1; i <= NumberOfRoads(); i++) {
        Move(i, x);
        if(Color() == 1) {
            ++cnt;
            a[x][cnt] = a[cnt][x] = 1;
            // cout << x << " : " << cnt << endl;
            dfs(cnt);
            Move(LastRoad(), Color());
        }
        else {
            // cout << x << " " << Color() << endl;
            a[x][Color()] = a[Color()][x] = 1;
            Move(LastRoad(), Color());
        }
    }
}
void Inspect(int R) {
    // Write your code here.
    for(int i = 1; i <= 200; i++) iter[i] = 1;
    memset(a, 0x7f, sizeof(a));
    dfs(2);
    for(int i = 2; i <= cnt; i++) {
        for(int j = 2; j <= cnt; j++) {
            for(int k = 2; k <= cnt; k++) {
                a[j][k] = min(a[j][k], a[j][i] + a[i][k]);
            }
        }
    }
    for(int i = 2; i <= cnt; i++) for(int j = 2; j <= cnt; j++) ans[a[i][j]]++;
    for(int i = 1; i <= R; i++) {
        Answer(i, ans[i]);
    }
}
